{include file="common/top" /}
<link  type="text/css" href="__static/ossupload/style.css"/>
<style>
html{
	background: #ffffff; 
}
</style>
<div class="layuimini-container">
	<div class="layui-col-xs12">
      <div class="layui-card">
        <div class="layui-card-header">账户退款</div>
        <div class="layui-card-body">
			<table class="layui-table">
			  <tbody>
			    <tr>
			      <td width=12%>编号:</td>
			      <td>{$rs.code}</td>
			      <td width=12%>渠道:</td>
			      <td colspan="2" style="color: red; font-weight: bold;">{$rs.channel_name}</td>
			      <td width=12%>账户ID:</td>
			      <td colspan="2">{$rs.name_id}</td>
			    </tr>
			    <tr>
			      <td>客户：</td>
			      <td>{$rs.customer_name}</td>
			      <td colspan="2">返点(客户/渠道)：</td>
			      <td colspan="4" style="color: red; font-weight: bold;">{$rs.rebate}/ {$rs.channel_rebate}</td>
			    </tr>
			    <tr>
			      <td >账户币：</td>
			      <td>{$rs.currency}</td>
			      <td >客户金额：</td>
			      <td colspan="2">{$rs.amount}</td>
			      <td >渠道金额：</td>
			      <td>{$rs.channel_money}</td>
			    </tr>
			  </tbody>
			</table>
        </div>
      </div>
    </div>
	<div class="layui-col-xs12">
      <div class="layui-card">
        <div class="layui-card-body">
			<form class="layui-form " action="" style="    background: #fff;">
				<div class="layui-form-item">
					<label class="layui-form-label">账户退款凭证：</label>
					<div class="layui-col-xs4" id="photos">
						<img src="{$rs.screenshot_url}" width="100%">
					</div>
					
				</div>
				<hr/>
				<div class="layui-form-item">
					<label class="layui-form-label">上传凭证：</label>
					<div class="layui-col-xs4">
						<div class="layui-upload-drag" id="test10">
						  	<i class="layui-icon"></i>
						  	<p>点击上传，或将文件拖拽到此处</p>
						  	<div class="layui-hide" id="uploadDemoView">
						  		<hr>
						    	<img src="" alt="上传成功后渲染" style="max-width: 196px">
						  	</div>
						</div>
					</div>
					
				</div>
				
				<hr />
				<div class="layui-form-item">
					<div class="layui-input-block">
						<input type="hidden"  name="id" value="{$rs.id}">
						<input type="hidden" id='image'  name="audit_proof_url" value="">
						<button class="layui-btn "  lay-submit="" lay-filter="demo1">确认</button>
					</div>
				</div>
			</form>
        </div>
      </div>
    </div>
</div>

{include file="common/footer" /}
<script type="text/javascript" src="__static/js/man.js"></script>
<script>
	layui.use(['form', 'layedit', 'laydate','table','upload'], function(){
		  var form = layui.form ,layer = layui.layer,table = layui.table ,upload = layui.upload,$ = layui.jquery;
		  var money=0;
		  //监听提交
		  form.on('submit(demo1)', function(data){
			var articleFrom = data.field;
			layer.load(1, { shade : [ 0.5, '#676a6c' ] }); 
			$.post("{:url('cashier_audit')}?t=json",articleFrom,function(data){
				layer.closeAll();
				
				if (data['code'] == 1) { 
					var index1 = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
					parent.layer.close(index1); //再执行关闭  
					//父页面数据 ，重新加载
					parent.get_apply(data['msg']);

				} else {
					layer.msg(data['msg'], { icon : 5 });
				}
			}); 
			
			return false;
		  });
		//拖拽上传
		  upload.render({
		    elem: '#test10'
		    ,url: '{:url("Upload/index")}' //改成您自己的上传接口
		    ,exts: 'jpg|png|jpeg|gif'
	    	,choose: function(obj){
	    		layer.load(1, { shade : [ 0.5, '#676a6c' ] });
	    	}
		    ,done: function(res){
		    	layer.closeAll();
		    	if(res.code == 0){
		    		layer.msg('上传成功');
				    layui.$('#uploadDemoView').removeClass('layui-hide').find('img').attr('src', res.data);
				    $("input[name=audit_proof_url]").val(res.data);
		    	}else{
		    		layer.msg(res.msg);
		    	}
		      
		      //console.log(res)
		    }
		  });
		//监听行单击事件
		layer.photos({
			photos: '#photos'
			,anim: 5 //0-6的选择，指定弹出图片动画类型，默认随机（请注意，3.0之前的版本用shift参数）
		});
		  
	});
	
</script>
